module.service('Post', ['$rootScope', function ($rootScope) {
    var service = {
        _baseUrl: "/azeroth/back/member/",
        currentPost: {},
        postList: [],
        totalItems: 0,
        queryList: function (post, callback) {

            $rootScope.ajaxRequestPost(service._baseUrl + "getPersonalFileList.htm", post, function (resultJson) {
                angular.copy(resultJson.data, service.postList);
                service.totalItems = resultJson.totalCount;
                if (callback) {
                    callback();
                }
            });
        },
        updatePostStatus: function (publishFileId, status, callback) {

            var paramData = {
                publishFileId: publishFileId,
                status: status
            }

            $rootScope.ajaxRequestPost(service._baseUrl + "updateStatus.htm", paramData, function (resultJson) {

                if (callback) {
                    callback();
                }
            });
        },
        deleteMem: function (member, callback) {

            $rootScope.ajaxRequestPost(service._baseUrl + "deleteAdmin.htm", member, function (resultJson) {

                if (callback) {
                    callback();
                }
            });
        }

    };
    return service;
}]);
